// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
import QtQuick 1.1
import com.nokia.symbian 1.1

Page {
    id: root

    signal aberto()
    signal fechado()
    signal carregado()

    function fecharTela()
    {
        anim.toOpacity = 0;
        anim.start();
    }

    Image {
        id: img
        anchors.fill: parent
        source: "qrc:///abertura"
        opacity: 1

        onStatusChanged: {
            if (img.status == Image.Ready)
            {
                root.carregado();
            }
        }
    }

    SequentialAnimation {
        id: anim

        property int toOpacity

        NumberAnimation {
            target: img; property: "opacity"; to: anim.toOpacity; duration: 1000
        }

        ScriptAction {
            script: {
                if (img.opacity == 1)
                    root.aberto();
                else
                    root.fechado();
            }
        }
    }
}
